package com.hu.zhcc.shiro.controller.xy;


import com.hu.zhcc.shiro.entity.xy.pojo.TAssessAnswer;
import com.hu.zhcc.shiro.entity.xy.pojo.TAssessQuestion;
import com.hu.zhcc.shiro.service.xy.service.TAssessAnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/tAssessAnswer")
public class TAssessAnswerController {
    @Autowired
    private TAssessAnswerService tAssessAnswerService;
    @PostMapping("/addAnswer")
    public void addAnswer(@RequestBody List<TAssessQuestion> tAssessQuestions, HttpSession session){
        tAssessAnswerService.addAnswer(tAssessQuestions,session);
    }

    @GetMapping("/selectAnswerList")
    public List<TAssessAnswer> selectAnswerList(@PathVariable("memberId") int userId ,int questionId){
        return tAssessAnswerService.selectTAssessByUserId(userId,questionId);
    }
}
